package com.tmanager.persistence.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@Entity
@Table(name = "t_user")
@NamedQueries({ @NamedQuery(name = User.GET_BY_EMAIL, query = "select u from User u where u.email = :email"),
		@NamedQuery(name = User.GET_ALL, query = "select u from User u"), })
public class User extends VersionedEntity {
	private static final Logger log = LoggerFactory.getLogger(User.class);
	public static final String GET_BY_EMAIL = "User.getByEmail";
	public static final String GET_ALL = "User.getAll";
	
	@Column(length = 100, unique = true, nullable = false)
	private String email;

	@Column(length = 50, nullable = false)
	private String password;

	public void setEmail(String email) {
		this.email = email;
	}

	public String getEmail() {
		return email;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getPassword() {
		return password;
	}
}
